<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./template.xhtml">

            <ui:define name="title">
                Report
            </ui:define>

            <ui:define name="content">
                <h:form>
                    <p:dataTable value="#{reportOfUserBean.res}" var="r" id="datatable" rows="20" resizableColumns="false">
                        <f:facet name="header">
                            List New Reports
                        </f:facet>
                        <p:column headerText="Username">
                            <h:link outcome="reportDetail" value="#{r.sender.username}">
                                <f:param name="reportid" value="#{r.reportID}" />
                            </h:link>
                        </p:column>
                        <p:column headerText="Device Name">
                            <h:link outcome="reportDetail" value="#{r.deviceID.devicename}">
                                <f:param name="reportid" value="#{r.reportID}" />
                            </h:link>
                        </p:column>
                        <p:column headerText="Lab Name">
                            <h:link outcome="reportDetail" value="#{r.deviceID.labID.labID}">
                                <f:param name="reportid" value="#{r.reportID}" />
                            </h:link>
                        </p:column>
                        <p:column headerText="Title">
                            <h:link outcome="reportDetail" value="#{r.title}">
                                <f:param name="reportid" value="#{r.reportID}" />
                            </h:link>
                        </p:column>
                        <p:column headerText="Status">
                            <h:link outcome="reportDetail">
                                <h:outputText value="#{r.status}">
                                    <f:converter converterId="Prolem" />
                                </h:outputText>
                                <f:param name="reportid" value="#{r.reportID}" />
                            </h:link>
                        </p:column>
                    </p:dataTable>
                    <p:commandButton value="Send Report" action="sendReport.xhtml?faces-redirect=true" />
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
